package com.atguigu.sparkcore.day03

import org.apache.spark.rdd.RDD
import org.apache.spark.{SparkConf, SparkContext}

/**
 * Author atguigu
 * Date 2020/10/30 15:45
 */
object SortDemo {
    def main(args: Array[String]): Unit = {
        val conf: SparkConf = new SparkConf().setAppName("SortDemo").setMaster("local[2]")
        val sc: SparkContext = new SparkContext(conf)
        val list1 = List(30, 50, 70, 60, 10, 20).map((_, 1))
        val rdd1= sc.parallelize(list1, 2).map(x => {
            println("map....")
            x
        })
        // a.txt 100 b.txt 100 c.txt 100 f.txt 600
        
        
        rdd1.sortByKey()
        Thread.sleep(10000000)
        sc.stop()
        
    }
}
